package com.ms.service.module.datacenterlite;

import com.ms.game.gmtool.message.SExtendPlayerKeepSeatTimeRequest;
import com.ms.game.gmtool.message.SGmtoolChangeGameModuleState;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.module.BasicServiceModule;


public class DataCenterLiteAction extends BaseMessageAction{
	
	@MessageType(typeCode = MessageTypes.S_GMTOOL_EXTEND_PLAYERS_KEEP_SEAT_TIME)
	public void RecieveGMtoolExtendPlayerKeepSeatTimeRequest(SExtendPlayerKeepSeatTimeRequest request){
		BasicServiceModule module = getModule();
		if(!(module instanceof DataCenterLiteModule)){
			return;
		}
		
		if(request.getExtendTime() <= 0)
			return;
		
		DataCenterLiteModule DCLiteModule = (DataCenterLiteModule) module;
		DCLiteModule.extendPlayersKeepSeatTime(request.getTargetGames(), request.getExtendTime());
	}
	
	@MessageType(typeCode = MessageTypes.S_GMTOOL_CHANGE_GAME_MODULE_STATE_TO_DCLITE)
	public void RecieveGMtoolChangeGameModuleState(SGmtoolChangeGameModuleState request){
		BasicServiceModule module = getModule();
		if(!(module instanceof DataCenterLiteModule)){
			return;
		}
		
		DataCenterLiteModule DCLiteModule = (DataCenterLiteModule) module;
		DCLiteModule.recGMToolChangeGameModuleState(request);
	}
	
}
